home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / 011-020 / amok16 / memsystem / errorreq.def next >
Text File  |  1993-11-04  |  3KB  |  68 lines

  1. (**********************************************************************
  2.  
  3.     :Program.    ErrorReq.def
  4.     :Contents.   Requesters or Messages to handle Errors, Warnings...
  5.     :Author.     Nicolas Benezan [bne]
  6.     :Address.    Postwiesenstr. 2, D7000 Stuttgart 60
  7.     :Phone.      711/333679
  8.     :Copyright.  Public Domain
  9.     :Language.   Modula-2
  10.     :Translator. M2Amiga AMSoft 3.2d
  11.     :History.    V1.0 [bne] 12.Jan.1989 (extracted from MemSystem1.1)
  12.     :History.    V1.1 [bne] 27.Jan.1989 (YesNoReq. modified, m2cV3.2)
  13.     :History.    V1.2 [bne] 5.Feb.1989 (+ Assert)
  14.  
  15. **********************************************************************)
  16.  
  17. DEFINITION MODULE ErrorReq;
  18.  
  19. FROM SYSTEM     IMPORT ADDRESS;
  20.  
  21. CONST   CANCEL="Cancel";
  22.         RETRY="Retry";
  23.         ABORT="Abort";
  24.         IGNORE="Ignore";
  25.         CONTINUE="Continue";
  26.  
  27. TYPE    Message=ARRAY [0..32] OF CHAR;
  28. VAR     ErrHeader:Message; (* Default: "Modula-2 Error Handler" *)
  29.         AssertMessage:Message;      (* "Break (Assert): " *)
  30.  
  31. PROCEDURE YesNoRequest(BodyText,PositiveText,NegativeText:ADDRESS):BOOLEAN;
  32. (*:Input.       ReqBody: Pointer to the text of the requester
  33.   :Input.       PositiveText: Pointer to the text of the Ok-gadget
  34.   :Input.       NegativeText: Pointer to the text of the Cancel-gadget
  35.   :Result.      TRUE: Ok-gadget FALSE: Cancel or error
  36.   :Semantic.    simplified Intuition.AutoRequest()
  37.   :Note.        the new V3.2-compiler supplies Arts.Requester()
  38. *)
  39.  
  40. PROCEDURE RecoverableExit(ReqBody,PosText,NegText:ADDRESS);
  41. (*:Input.       ReqBody: Pointer to the Headline of the requester
  42.   :Input.       PosText: Pointer to the text of the Ok-gadget
  43.   :Input.       NegText: Pointer to the text of the Cancel-gadget
  44.   :Semantic.    Displays a requester, Cancel terminates the
  45.   :Semantic.    programm, Ok lets it continue
  46. *)
  47.  
  48. PROCEDURE DeadEndExit(ReqBody:ADDRESS);
  49. (*:Input.       ReqBody: Pointer to a String
  50.   :Semantic.    Displays a Requester with ErrHeader as Headline and ReqBody
  51.   :Semantic.    as second line. The Cancel-gadget terminates the program.
  52. *)
  53.  
  54. PROCEDURE Assert(Condition:BOOLEAN;Text:ADDRESS);
  55. (*:Input.       Condition to be asserted for the programm to continue
  56.   :Input.       Text: pointer to a null terminated string
  57.   :Semantic.    Terminates the programm if Condition is NOT TRUE.
  58.   :Semantic.    If wbStarted, it will display a requester like Arts.Assert()
  59.   :Semantic.    If CLI-started, it will print Text and Exit immediately
  60. *)
  61.  
  62. PROCEDURE ExitQuiet;
  63. (*:Semantic.    simply terminates the program (TermProcedures work
  64.   :Semantic.    normally)  *)
  65.  
  66. END ErrorReq.
  67.  
  68.